<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContextPath() + '/'}"/>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
    <!-- Reset Stylesheet -->
    <link rel="stylesheet" href="resources/css/reset.css" type="text/css"
          media="screen" />
    <!-- Main Stylesheet -->
    <link rel="stylesheet" href="resources/css/style.css" type="text/css"
          media="screen" />
    <link rel="stylesheet" href="resources/css/invalid.css" type="text/css"
          media="screen" />


    <!--                       Javascripts                       -->
    <!-- jQuery -->
    <script type="text/javascript"
            src="resources/scripts/jquery-1.8.3.min.js"></script>

    <!-- 添加弹出框依赖 -->
    <script type="text/javascript"
            src="resources/widget/dialog/jquery-ui-1.9.2.custom.min.js"></script>
    <link rel="stylesheet" href="resources/widget/dialog/jquery-ui.min.css" type="text/css"
          media="screen" />

    <!-- 动态表单的js -->
    <script type="text/javascript"
        src="resources/js/dynamic-form.js"></script>

</head>
<body>
<div id="main-content">
    <div class="content-box">
        <div class="content-box-content">
            <div class="tab-content default-tab" id="tab2">
                <form id="templateForm" action="/system/coupon/templateinsert" method="post">
                    <fieldset>
                        <!-- 隐藏域 - 当前模板的动态字段 -->
                        <input id="templateDynamic" type="hidden" name="templateDynamic" value=""/>

                        <p>
                            <label>模板名称</label> <input
                                class="text-input small-input" type="text"
                                name="tname" />
                        </p>

                        <p>
                            <label>模板类型</label>
                                <input
                                    type="radio" name="templateType" value="0" checked/> 规则模板
                                <input
                                    type="radio" name="templateType" value="1"/> 限制模板
                        </p>

                        <p>
                            <label>模板对应的实现类</label>
                            <input
                                class="text-input medium-input datepicker" type="text"
                                name="templateClass" />
                        </p>

                        <!-- 动态字段的展示div -->
                        <div id="dynamicDiv">

                        </div>

                        <button onclick="addDynamicField();" class="mybutton" type="button" style="margin-top: 20px">新增规则的动态字段</button>

                        <p>
                            <input class="mybutton" type="button" onclick="submitTemplate();" value="提交" />
                        </p>
                    </fieldset>
                    <div class="clear"></div>
                    <!-- End .clear -->
                </form>
            </div>
            <!-- End #tab2 -->
        </div>
        <!-- End .content-box-content -->
    </div>
</div>




<!-- End #main-content -->
</body>
</html>